ES6 新功能


Posted by Rich on 2021-04-25

let name = rich
console.log(`hello ${name}`)
//output: hello rich
var  obj = {
    a:1,
    b:2
}
var obj2 = {
    ...obj,   ///destructuring
    c: 3
}
var {a, ...rest} = obj2 //rest parameters
console.log(rest)
//output:{b: 2, c: 3}









Related Posts

Command Line 筆記

Command Line 筆記

Git 狀況劇_我把錯的資料夾初始化了

Git 狀況劇_我把錯的資料夾初始化了

JavaScript 學習筆記 - Function

JavaScript 學習筆記 - Function


Comments